home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Palettes / SwitchBox / SwitchBox.h < prev    next >
Text File  |  1995-06-12  |  2KB  |  75 lines

  1. /*
  2.  *    
  3.  *    Copyright (C) 1992  Ronin Consulting, Inc.
  4.  *
  5.  *    This program is free software; you can redistribute it and/or modify
  6.  *    it under the terms of the GNU General Public License as published by
  7.  *    the Free Software Foundation; version 1.
  8.  *
  9.  *    This program is distributed in the hope that it will be useful,
  10.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  *    GNU General Public License for more details.
  13.  *
  14.  *    You should have received a copy of the GNU General Public License
  15.  *    along with this program; if not, write to the Free Software
  16.  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  *
  18.  * This subclass of box allows a regions view to be swapped from a list of views.
  19.  * Views can be assigned in Interface Builder by connecting to the panel outlets
  20.  * or programmatally with the setPanel:at: method.
  21.  *
  22.  * To Do:
  23.  * Currently does not handle being resized.
  24.  */
  25.  
  26. #import <appkit/Box.h>
  27.  
  28. @interface SwitchBox:Box
  29. {
  30.     id    panel0;
  31.     id    panel1;
  32.     id    panel2;
  33.     id    panel3;
  34.     id    panel4;
  35.     id    panel5;
  36.     id    panel6;
  37.     id    panel7;
  38.     id    panel8;
  39.     id    panel9;
  40.  
  41.     id panelList;
  42.     id delegate;
  43.     id origContentView;
  44.     int defaultPanel;
  45. }
  46.  
  47. - initFrame:(const NXRect *)aRect;
  48. - free;
  49. - drawSelf:(const NXRect *)rects :(int)rectCount;
  50.  
  51. - switchToTagOf: sender;             /* switch to panelN where N = [sender tag] */
  52. - switchTo: (int) number;             /* switch to panelN where N = number */
  53. - setDefaultPanel: (int) number;
  54. - (int) defaultPanel;
  55.  
  56. - setDelegate: anObject;
  57. - delegate;
  58.  
  59. - setPanel: aView at: (int) index;         /* place a view in the SwitchBox' list at a given index */
  60.  
  61. - (const char *)getInspectorClassName;
  62. - read:(NXTypedStream *) s;
  63. - write:(NXTypedStream *) s;
  64.  
  65. @end
  66.  
  67. @interface Object(SwitchBoxDelegate)         /* Your delegate can implement these... */
  68.  
  69. - willSwitchTo: (int)number;             /* warns yopu before a switch - nil return aborts switch */
  70. - didSwitchTo: (int)number;             /* tells you after switch is made */
  71.  
  72. @end
  73.  
  74.  
  75.